import java.sql.*;

public class JDBCTest {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.cj.jdbc.Driver");

        String url = "jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=true";
        String name = "root";
        String password = "ljc981020";

        Connection connection = DriverManager.getConnection(url, name, password);

        Statement statement = connection.createStatement();

        String sql = "SELECT * FROM Error";

        ResultSet resultSet = statement.executeQuery(sql);
        while(resultSet.next()){

            String name1 = (String)  resultSet.getObject("name");
            System.out.println("名字是"+name1);
        }

    }
}
